package com.tripshare.sdk.weixin.converter;

import com.tripshare.sdk.weixin.format.WeixinBaseMsg;
import com.tripshare.sdk.weixin.format.WeixinBaseReplyMsg;

import java.lang.reflect.InvocationTargetException;

/**
 * xml的文本格式 与 内存结构格式 之间的转换器
 */
public interface Converter {

    /**
     * 接受消息的序列化转换器
     *
     * @param msg
     * @return
     */
    WeixinBaseMsg convert(String msg) throws IllegalAccessException, InvocationTargetException, InstantiationException;

    /**
     * 回复消息的反序列化转换器
     *
     * @param msg
     * @return
     */
    String convert(WeixinBaseMsg msg) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException;


}
